//
//  CJContentOfDivsionPageModel.m
//  CoJellyCartoon
//
//  Created by dllo on 16/4/1.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "CJContentOfDivsionPageModel.h"

@interface CJContentOfDivsionPageModel ()
@property (nonatomic, strong) NSMutableArray *recommendsArray;
@property (nonatomic, strong) NSMutableArray *bannersArray;
@property (nonatomic, strong) NSMutableArray *newsArray;

@end
@implementation CJContentOfDivsionPageModel
- (instancetype)initWithDataSource : (NSDictionary *)dataSource
{
    self = [super init];
    [self setValuesForKeysWithDictionary:dataSource];
    if (self) {
        self.recommendsArray = [NSMutableArray arrayWithCapacity:0];
        self.bannersArray = [NSMutableArray arrayWithCapacity:0];
        self.newsArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.recommends) {
            CJDivsionMixModel *recModel = [[CJDivsionMixModel alloc] init];
            [recModel setValuesForKeysWithDictionary:dic];
            [self.recommendsArray addObject:recModel];
        }
        self.recommends = [NSArray arrayWithArray:self.recommendsArray];
        
        for (NSDictionary *dic in self.banners) {
            CJDivsionMixModel *bannerModel = [[CJDivsionMixModel alloc] init];
            [bannerModel setValuesForKeysWithDictionary:dic];
            [self.bannersArray addObject:bannerModel];
        }
        self.banners =[NSArray arrayWithArray:self.bannersArray];
        
        for (NSDictionary *dic in self.news) {
            CJDivsionMixModel *newsModel = [[CJDivsionMixModel alloc] init];
            [newsModel setValuesForKeysWithDictionary:dic];
            [self.newsArray addObject:newsModel];

        }
         self.news =[NSArray arrayWithArray:self.newsArray];
    }
    return self;
}
@end
